<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="utf-8">
  
  <title>xposed模块编写之常用hook函数API | 探花需拔根</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  
    <meta name="keywords" content="Bluarry,bluarry,Blog,探花,拔根,博客,区块链,算法,acm">
  
  <meta name="description" content="​       为了编写xposed模块，必须了解常用的hook API，所以，接下来我就用一个例子来说明。">
<meta name="keywords" content="安卓,android,xposed,xposed模块">
<meta property="og:type" content="article">
<meta property="og:title" content="xposed模块编写之常用hook函数API">
<meta property="og:url" content="/2020/02/28/2020-02-28-xposed模块编写之常用hook函数API/index.html">
<meta property="og:site_name" content="探花需拔根">
<meta property="og:description" content="​       为了编写xposed模块，必须了解常用的hook API，所以，接下来我就用一个例子来说明。">
<meta property="og:locale" content="zh.yml">
<meta property="og:image" content="https://cdn.bluarry.top/wp-content/uploads/2020/02/hook1.jpg">
<meta property="og:image" content="https://cdn.bluarry.top/wp-content/uploads/2020/02/hook2.jpg">
<meta property="og:updated_time" content="2020-03-02T12:53:47.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="xposed模块编写之常用hook函数API">
<meta name="twitter:description" content="​       为了编写xposed模块，必须了解常用的hook API，所以，接下来我就用一个例子来说明。">
<meta name="twitter:image" content="https://cdn.bluarry.top/wp-content/uploads/2020/02/hook1.jpg">
  
  
    <link rel="icon" href="/favicon.ico">
  
  <link href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
  <link rel="stylesheet" href="/css/style.css">
  <script src="/js/pace.min.js"></script>
  

  
  

  
<!-- Matomo -->
<script type="text/javascript">
	var _paq = window._paq || [];
	/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
	_paq.push(['trackPageView']);
	_paq.push(['enableLinkTracking']);
	(function() {
	  var u="//matomo.bluarry.top/";
	  _paq.push(['setTrackerUrl', u+'matomo.php']);
	  _paq.push(['setSiteId', '3']);
	  var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
	  g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
	})();
  </script>
  <!-- End Matomo Code -->

</head>
</html>
<body>
  <div id="container">
      <header id="header">
    <div id="banner"></div>
    <div id="header-outer">
        <div id="header-menu" class="header-menu-pos animated">
            <div class="header-menu-container">
                <a href="/" class="left">
                    <span class="site-title">探花需拔根</span>
                </a>
                <nav id="header-menu-nav" class="right">
                    
                    <a  href="/">
                        <i class="fa fa-home"></i>
                        <span>主页</span>
                    </a>
                    
                    <a  href="/archives">
                        <i class="fa fa-archive"></i>
                        <span>归档</span>
                    </a>
                    
                    <a  href="/friends">
                        <i class="fa fa-envira"></i>
                        <span>友链</span>
                    </a>
                    
                    <a  href="/about">
                        <i class="fa fa-user"></i>
                        <span>关于我</span>
                    </a>
                    
                </nav>
                <a class="mobile-header-menu-button">
                    <i class="fa fa-bars"></i>
                </a>
            </div>
        </div>
        <div id="header-row">
            <div id="logo">
                <a href="/">
                    <img src="/images/avatar/me-130x130.jpg" alt="logo">
                </a>
            </div>
            <div class="header-info">
                <div id="header-title">
                    
                    <h2>
                        清风觅影
                    </h2>
                    
                </div>
                <div id="header-description">
                    
                    <h3>
                        致需极,守静笃
                    </h3>
                    
                </div>
            </div>
            <nav class="header-nav">
                <div class="social">
                    
                        <a title="Home"  href="/">
                            <i class="fa fa-home fa-2x"></i></a>
                    
                        <a title="Github" target="_blank" href="//github.com/bluarry">
                            <i class="fa fa-github fa-2x"></i></a>
                    
                        <a title="mail" target="_blank" href="mailto://bluarry@qq.com">
                            <i class="fa fa-envelope-o fa-2x"></i></a>
                    
                </div>
            </nav>
        </div>
    </div>
</header>
      <div class="outer">
        <section id="main" class="body-wrap"><article id="post-2020-02-28-xposed模块编写之常用hook函数API" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-inner">
    
      <header class="article-header">
        
  
    <h1 class="post-title" itemprop="name">
      xposed模块编写之常用hook函数API
    </h1>
    <div class="post-title-bar">
      <ul>
          
              <li>
                  <i class="fa fa-book"></i>
                  
                      <a href="/categories/经验分享/">经验分享</a>
                  
                      <a href="/categories/学习分享/">学习分享</a>
                  
              </li>
          
        <li>
          <i class="fa fa-calendar"></i>  2020-02-28
        </li>
        <li>
          <i class="fa fa-eye"></i>
          <span id="busuanzi_value_page_pv"></span>
        </li>
      </ul>
    </div>
  

          
      </header>
    
    <div class="article-entry post-content" itemprop="articleBody">
      
            
            <p>​       为了编写xposed模块，必须了解常用的hook API，所以，接下来我就用一个例子来说明。<br><a id="more"></a></p>
<h1>hook目标</h1>

<ol>
<li>hook目标类

​    代码比较长，所以肯定没有人有耐心看，所以建议直接跟着后面的说明来理解。<p></p></li>
</ol>

<pre><code class="language-java line-numbers">/*注意这里是伪代码*/
package cn.bluarry.hookme;

import android.util.Log;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

abstract class Animal{
    int anonymoutInt = 500;
    public abstract void eatFunc(String value);
}
public class HookDemo {
    private String Tag = "HookDemo";
    private static  int staticInt = 100;
    public  int publicInt = 200;
    private int privateInt = 300;

    public HookDemo(){
        this("NOHook");
        Log.d(Tag, "HookDemo() was called|||");
    }

    private HookDemo(String str){
        Log.d(Tag, "HookDemo(String str) was called|||" + str);
    }

    public void hookDemoTest(){
        Log.d(Tag, "staticInt = " + staticInt);
        Log.d(Tag, "PublicInt = " + publicInt);
        Log.d(Tag, "privateInt = " + privateInt);
        publicFunc("NOHook");
        Log.d(Tag, "PublicInt = " + publicInt);
        Log.d(Tag, "privateInt = " + privateInt);
        privateFunc("NOHook");
        staticPrivateFunc("NOHook");

        String[][] str = new String[1][2];
        Map map = new HashMap&lt;String, String&gt;();
        map.put("key", "value");
        ArrayList arrayList = new ArrayList();
        arrayList.add("listValue");
        complexParameterFunc("NOHook", str, map, arrayList);

        repleaceFunc();
        anonymousInner(new Animal() {
            @Override
            public void eatFunc(String value) {
                Log.d(Tag, "eatFunc(String value)  was called|||" + value);
                Log.d(Tag, "anonymoutInt =  " + anonymoutInt);
            }
        }, "NOHook");

        InnerClass innerClass = new InnerClass();
        innerClass.InnerFunc("NOHook");
    }

    public void publicFunc(String value){
        Log.d(Tag, "publicFunc(String value) was called|||" + value);
    }

    private void privateFunc(String value){
        Log.d(Tag, "privateFunc(String value) was called|||" + value);
    }

    static private void staticPrivateFunc(String value){
        Log.d("HookDemo", "staticPrivateFunc(Strin value) was called|||" + value);
    }

    private void complexParameterFunc(String value, String[][] str, Map&lt;String,String&gt; map, ArrayList arrayList)
    {
        Log.d("HookDemo", "complexParameter(Strin value) was called|||" + value);
    }
    private void repleaceFunc(){
        Log.d(Tag, "repleaceFunc will be replace|||");
    }
    public void anonymousInner(Animal dog, String value){
        Log.d(Tag, "anonymousInner was called|||" + value);
        dog.eatFunc("NOHook");
    }

    private void hideFunc(String value){
        Log.d(Tag, "hideFunc was called|||" + value);
    }

    class InnerClass{
        public int innerPublicInt = 10;
        private int innerPrivateInt = 20;
        public InnerClass(){
            Log.d(Tag, "InnerClass constructed func was called");
        }
        public void InnerFunc(String value){
            Log.d(Tag, "InnerFunc(String value) was called|||" + value);
            Log.d(Tag, "innerPublicInt = " + innerPublicInt);
            Log.d(Tag, "innerPrivateInt = " + innerPrivateInt);
        }
    }
}
</code></pre>

<ol start="2">
<li><p>对目标类的说明

​        使用说明:  用AS来构建一个安卓应用，直接默认一个mainActivity，在Oncreate方法里实例化我们的HookDemo类，然后调用hookDemoTest()方法即可。

​    为进行hook前的输出如下图一:</p></li>
</ol>

<p></p><p><center>
    <img style="border-radius: 0.3125em;box-shadow: 0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.08);" src="https://cdn.bluarry.top/wp-content/uploads/2020/02/hook1.jpg">
    <br>
    <div style="color:orange; border-bottom: 1px solid #d9d9d9;display: inline-block;color: #999;padding: 2px;">图一</div>
</center></p>
<h1>hook API</h1>

<h2>1. hook 静态变量</h2>

<p>​       对应于上面的例子，实际上是hook变量staticInt,相应的方法如下:</p>
<pre><code class="language-java line-numbers">final Class&lt;?&gt; clazz = XposedHelpers.findClass("cn.bluarry.hookme.HookDemo", lpparam.classLoader);
XposedHelpers.setStaticIntField(clazz, "staticInt", 99); 
</code></pre>

<p>​       上面的例子只演示了hook 类型 static int的变量，其他类型的API同上，只需要将Int改为 long,double,object等，结合具体情况拓展即可。</p>
<h2>2. hook 无参构造函数</h2>

<p>​       hook此构造函数比较简单，具体代码如下:</p>
<pre><code class="language-java line-numbers"> XposedHelpers.findAndHookConstructor(clazz, new XC_MethodHook() {
                @Override
        protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    XposedBridge.log("Haha, HookDemo constructed was hooked" );
                }
            });
</code></pre>

<h2>3. Hook公有方法</h2>

<p>​       主要 1.修改参数 2.修改下publicInt和privateInt的值</p>
<pre><code class="line-numbers">  XposedHelpers.findAndHookMethod(clazz, "publicFunc", String.class, new XC_MethodHook() {
                @Override
     protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    param.args[0] = "Haha, publicFunc are hooked";
                    XposedHelpers.setIntField(param.thisObject, "publicInt", 199);
                    XposedHelpers.setIntField(param.thisObject, "privateInt", 299);
                }
  });
</code></pre>

<h2>4. hook方法后/前/时，调用其他方法</h2>

<pre><code>    这里主要调用hideFunc,如下
</code></pre>

<pre><code class="language-java line-numbers">XposedHelpers.findAndHookMethod(clazz, "publicFunc", String.class, new XC_MethodHook() {
                @Override
    protected void afterHookedMethod(MethodHookParam param) throws Throwable {
       // 让hook的对象本身去执行流程
       Method md = clazz.getDeclaredMethod("hideFunc", String.class);
       md.setAccessible(true);
      //方法一:
      //md.invoke(param.thisObject, "Haha, hideFunc was hooked");
      //方法二： 
    XposedHelpers.callMethod(param.thisObject, "hideFunc", "Haha, hideFunc was hooked");
      //方法三: 
      //实例化对象，然后再调用HideFunc方法
      //Constructor constructor = clazz.getConstructor();
      //XposedHelpers.callMethod(constructor.newInstance(), "hideFunc", "Haha, hideFunc was hooked");
                }
            });
</code></pre>

<h2>5. Hook私有方法</h2>

<pre><code class="language-java line-numbers">XposedHelpers.findAndHookMethod(clazz, "privateFunc", String.class, new XC_MethodHook() {
                @Override
   protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    param.args[0] = "Haha, privateFunc are hooked";
                }
   });
</code></pre>

<h2>6. Hook私有静态方法</h2>

<pre><code class="language-java line-numbers"> XposedHelpers.findAndHookMethod(clazz, "staticPrivateFunc", String.class, new XC_MethodHook() {
       @Override
      protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    param.args[0] = "Haha, staticPrivateFunc are hooked";
   }
  });
</code></pre>

<h2>7.Hook复杂参数函数</h2>

<p>​       这里说明一下，首先构造了两个复杂参数Map和ArrayList，调用的时候，基本类型如String，直接写String.class, 而对于String数组的写法如代码中所写，<strong>注意写法</strong>。</p>
<pre><code class="language-java line-numbers">Class fclass1 = XposedHelpers.findClass("java.util.Map", lpparam.classLoader);
Class fclass2 = XposedHelpers.findClass("java.util.ArrayList", lpparam.classLoader);
XposedHelpers.findAndHookMethod(clazz, "complexParameterFunc", String.class,
    "[[Ljava.lang.String;", fclass1, fclass2, new XC_MethodHook() {
                        @Override
                        protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                            param.args[0] = "Haha, complexParameterFunc are hooked";
                        }
                    });
</code></pre>

<h2>8. Hook私有方法</h2>

<pre><code class="language-java line-numbers">XposedHelpers.findAndHookMethod(clazz, "repleaceFunc", new XC_MethodReplacement() {
                @Override
    protected Object replaceHookedMethod(MethodHookParam methodHookParam) throws Throwable {
                    Log.d("HookDemo", "Haha, repleaceFunc are replaced");
                    return null;
   }
  });
</code></pre>

<h2>9. Hook方法, anonymousInner， 参数是抽象类</h2>

<p>​       这也是一种情况，即参数为某抽象类的new出来的匿名类,<strong>注意，hook的是该方法，匿名类的方法并未hook!</strong></p>
<pre><code class="language-java line-numbers">Class animalClazz  = lpparam.classLoader.loadClass("cn.bluarry.hookme.Animal");
XposedHelpers.findAndHookMethod(clazz, "anonymousInner", animalClazz, String.class, new XC_MethodHook() {
                @Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    XposedBridge.log("HookDemo This is test");
                    param.args[1] = "Haha, anonymousInner are hooked";
                }
});
</code></pre>

<h2>10.Hook匿名类的方法</h2>

<pre><code class="language-java line-numbers">XposedHelpers.findAndHookMethod("cn.bluarry.hookme.HookDemo$1", clazz.getClassLoader(),
        "eatFunc", String.class, new XC_MethodHook() {
            @Override
     protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                param.args[0] = "Haha, eatFunc are hooked";
                XposedHelpers.setIntField(param.thisObject, "anonymoutInt", 499);
            }
});
</code></pre>

<h2>11. Hook内部类的方法，修改参数</h2>

<pre><code class="language-java line-numbers">  final Class&lt;?&gt; clazz1 = XposedHelpers.findClass("cn.bluarry.hookme.HookDemo$InnerClass", lpparam.classLoader);
            XposedHelpers.findAndHookMethod(clazz1, "InnerFunc", String.class, new XC_MethodHook() {
                @Override
         protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    param.args[0] = "Haha, InnerFunc was hooked";
                    XposedHelpers.setIntField(param.thisObject, "innerPublicInt", 9);
                    XposedHelpers.setIntField(param.thisObject, "innerPrivateInt", 19);
                }
     });
</code></pre>

<h2>hook结果</h2>

<center>
   <img style="border-radius: 0.3125em;
   box-shadow: 0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.08);" src="https://cdn.bluarry.top/wp-content/uploads/2020/02/hook2.jpg">
   <br>

<div style="color:orange; border-bottom: 1px solid #d9d9d9;
   display: inline-block;
   color: #999;
   padding: 2px;">图一</div>

</center>

<h1>本文章的项目地址</h1>

<p><a href="https://gitee.com/bluarry/hookDemo/tree/master/hookme" target="_blank" rel="noopener">hookme</a></p>
<p><a href="https://gitee.com/bluarry/hookDemo/tree/master/xpdemo2" target="_blank" rel="noopener">hookDemo</a></p>

            <div class="post-copyright">
    <div class="content">
        <p>最后更新： 2020年03月02日 20:53</p>
        <p>原始链接： <a class="post-url" href="/2020/02/28/2020-02-28-xposed模块编写之常用hook函数API/" title="xposed模块编写之常用hook函数API">/2020/02/28/2020-02-28-xposed模块编写之常用hook函数API/</a></p>
        <footer>
            <a href="">
                <img src="/images/avatar/me-130x130.jpg" alt="bluarry">
                bluarry
            </a>
        </footer>
    </div>
</div>

      
        
            
<div class="page-reward">
    <a id="rewardBtn" href="javascript:;">赏</a>
</div>

<div id="reward" class="post-modal reward-lay">
    <a class="close" href="javascript:;" id="reward-close">×</a>
    <span class="reward-title">
        <i class="icon icon-quote-left"></i>
        请我吃糖~
        <i class="icon icon-quote-right"></i>
    </span>
    <div class="reward-content">
        
        <div class="reward-code">
            <img id="rewardCode" src="/images/wechat_code.jpg" alt="打赏二维码">
        </div>
        <div class="reward-select">
            
            <label class="reward-select-item checked" data-id="wechat" data-wechat="/images/wechat_code.jpg">
                <img class="reward-select-item-wechat" src="/images/wechat.png" alt="微信">
            </label>
            
            
            <label class="reward-select-item" data-id="alipay" data-alipay="/images/alipay_code.jpg">
                <img class="reward-select-item-alipay" src="/images/alipay.png" alt="支付宝">
            </label>
            
        </div>
    </div>
</div>


        
    </div>
    <footer class="article-footer">
        
        
<div class="post-share">
    <a href="javascript:;" id="share-sub" class="post-share-fab">
        <i class="fa fa-share-alt"></i>
    </a>
    <div class="post-share-list" id="share-list">
        <ul class="share-icons">
          <li>
            <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=/2020/02/28/2020-02-28-xposed模块编写之常用hook函数API/&title=《xposed模块编写之常用hook函数API》 — 探花需拔根&pic=images/avatar/me-130x130.jpg" data-title="微博">
              <i class="fa fa-weibo"></i>
            </a>
          </li>
          <li>
            <a class="weixin share-sns" id="wxFab" href="javascript:;" data-title="微信">
              <i class="fa fa-weixin"></i>
            </a>
          </li>
          <li>
            <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=/2020/02/28/2020-02-28-xposed模块编写之常用hook函数API/&title=《xposed模块编写之常用hook函数API》 — 探花需拔根&source=​       为了编写xposed模块，必须了解常用的hook API，所以，接下来我就用一个例子来说明。" data-title="QQ">
              <i class="fa fa-qq"></i>
            </a>
          </li>
          <li>
            <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=/2020/02/28/2020-02-28-xposed模块编写之常用hook函数API/" data-title="Facebook">
              <i class="fa fa-facebook"></i>
            </a>
          </li>
          <li>
            <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《xposed模块编写之常用hook函数API》 — 探花需拔根&url=/2020/02/28/2020-02-28-xposed模块编写之常用hook函数API/&via=" data-title="Twitter">
              <i class="fa fa-twitter"></i>
            </a>
          </li>
          <li>
            <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=/2020/02/28/2020-02-28-xposed模块编写之常用hook函数API/" data-title="Google+">
              <i class="fa fa-google-plus"></i>
            </a>
          </li>
        </ul>
     </div>
</div>
<div class="post-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;" id="wxShare-close">×</a>
    <p>扫一扫，分享到微信</p>
    <img src="" alt="微信分享二维码">
</div>

<div class="mask"></div>

        
        <ul class="article-footer-menu">
            
            
  <li class="article-footer-tags">
    <i class="fa fa-tags"></i>
      
    <a href="/tags/安卓/" class="color3">安卓</a>
      
    <a href="/tags/android/" class="color3">android</a>
      
    <a href="/tags/xposed/" class="color2">xposed</a>
      
    <a href="/tags/xposed模块/" class="color4">xposed模块</a>
      
  </li>

        </ul>
        
        

    <aside class="post-toc-pos post-toc-top" id="post-toc">
        <nav class="post-toc-wrap">
            <ol class="post-toc"><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#null"><span class="post-toc-text">hook目标</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#null"><span class="post-toc-text">hook API</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#null"><span class="post-toc-text">1. hook 静态变量</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#null"><span class="post-toc-text">2. hook 无参构造函数</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#null"><span class="post-toc-text">3. Hook公有方法</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#null"><span class="post-toc-text">4. hook方法后/前/时，调用其他方法</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#null"><span class="post-toc-text">5. Hook私有方法</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#null"><span class="post-toc-text">6. Hook私有静态方法</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#null"><span class="post-toc-text">7.Hook复杂参数函数</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#null"><span class="post-toc-text">8. Hook私有方法</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#null"><span class="post-toc-text">9. Hook方法, anonymousInner， 参数是抽象类</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#null"><span class="post-toc-text">10.Hook匿名类的方法</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#null"><span class="post-toc-text">11. Hook内部类的方法，修改参数</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#null"><span class="post-toc-text">hook结果</span></a></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#null"><span class="post-toc-text">本文章的项目地址</span></a></li></ol>
        </nav>
    </aside>
    

<nav id="article-nav">
  
    <a href="/2020/03/25/2020-03-25-Interledger_Approaches(选)/" id="article-nav-newer" class="article-nav-link-wrap">

      <span class="article-nav-title">
        <i class="fa fa-hand-o-left" aria-hidden="true"></i>
        
          Interledger Approaches(选)
        
      </span>
    </a>
  
  
    <a href="/2020/01/12/2020-01-12-区块链核心技术之基本问题/" id="article-nav-older" class="article-nav-link-wrap">
      <span class="article-nav-title">区块链核心技术之基本问题</span>
      <i class="fa fa-hand-o-right" aria-hidden="true"></i>
    </a>
  
</nav>




    <!-- HTML页面布局 -->
    <div id="tab-list">
        <ul id="ul1">
            
            
            
            <li id="gittalk" style="width: 25%;">gittalk</li>
            
            
            <li id="valine" style="width: 25%;">valine</li>
            
        </ul>
         
        
          
        <div id="dv_gitment" class="hide">
            <div id="git_comments"></div>;
        </div>
        
        
        <div id="dv_vment" class="show">
            <div class="comments vcomment" id="vcomments"></div>
        </div>
        
    </div>

    <script src="/js/tablist.js"></script>
   

    
        
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">
<script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
<script src="https://cdn.bluarry.top/cdn/js/md5.min.js"></script>
<!--<div id="git_comments"></div>-->
<script>
    // var gitment = new Gitment({
    //     owner: 'bluarry',
    //     repo: 'blog_comment',
    //     oauth: {
    //         client_id: '5c95f5b820d109c8f5c1',
    //         client_secret: 'f1cfe5b08f9a55923ba26a9ec8855b631002ad18',
    //     },
    // })
    var hrefs=location.href;
    var links=hrefs.split('/');
    var cr="";
    for (var i=0;i<Math.min(7,links.length);i++) {
        cr+=links[i];
    }
    console.log(cr);

    var gitalk = new Gitalk({
        clientID: '5c95f5b820d109c8f5c1', //Client ID
        clientSecret: 'f1cfe5b08f9a55923ba26a9ec8855b631002ad18', //Client Secret
        repo: 'blog_comment',//仓库名称
        owner: 'bluarry',//仓库拥有者
        admin: ['bluarry'],
        id: md5(cr),      // Ensure uniqueness and length less than 50
        distractionFreeMode: false  // Facebook-like distraction free mode
    });
    gitalk.render('git_comments');
</script>


    
        <!-- Valine Comments -->
<!-- <div class="comments vcomment" id="vcomments"></div>-->
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="//unpkg.com/valine@latest/dist/Valine.min.js"></script>
<!-- Valine Comments script -->
<script>
    var GUEST_INFO = ['nick','mail','link'];
    var guest_info = 'nick,mail'.split(',').filter(function(item){
        return GUEST_INFO.indexOf(item) > -1
    });
    new Valine({
        el: '#vcomments',
        notify: 'true' == 'true',
        verify: 'false' == 'true',
        appId: "DRrkhLYTmB6QwGy6sI6vCH8C-gzGzoHsz",
        appKey: "M4A4lrKwbixQmmeO5lVdY5l2",
        avatar: "mm",
        placeholder: "少侠，留下你的评论吧",
        guest_info: guest_info.length == 0 ? GUEST_INFO : guest_info,
        pageSize: "10"
    })
</script>
<!-- Valine Comments end -->

    


    </footer>
  </div>
</article>


</section>
        
      </div>
      <footer id="footer">
  <div class="outer">
    <div id="footer-info" class="inner">
      
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        <i class="fa fa-user"></i>&nbsp;&nbsp;<span id="busuanzi_value_site_uv"></span>
    </span>&nbsp;&nbsp;|&nbsp;&nbsp;
    <span id="busuanzi_container_site_pv" style='display:none'>
        <i class="fa fa-eye"></i> &nbsp;&nbsp;<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


      <p>
      &copy; 2016-2021 &nbsp;&nbsp;<i style="color: red;" class="fa fa-heart"></i>&nbsp;&nbsp; bluarry
      备案号: <a style="color: #999;" href="http://www.beian.miit.gov.cn/" target="_blank">陕ICP备2020012959号</a>
    </p>

    </div>
  </div>
</footer>
    <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<script src="//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script>
  var mihoConfig = {
      root: "",
      animate: true,
      isHome: false,
      share: true,
      reward: 1
  }
</script>
<div class="sidebar">
    <div id="sidebar-search" title="Search">
        <i class="fa fa-search"></i>
    </div>
    <div id="sidebar-category" title="Categories">
        <i class="fa fa-book"></i>
    </div>
    <div id="sidebar-tag" title="Tags">
        <i class="fa fa-tags"></i>
    </div>
    <div id="sidebar-top">
        <span class="sidebar-top-icon"><i class="fa fa-angle-up"></i></span>
    </div>
</div>
<div class="sidebar-menu-box" id="sidebar-menu-box">
    <div class="sidebar-menu-box-container">
        <div id="sidebar-menu-box-categories">
            <a class="category-link" href="/categories/linux/">linux</a><a class="category-link" href="/categories/linux-学习/">linux 学习</a><a class="category-link" href="/categories/linux-学习-acm-onlinejudge-hustoj/">linux 学习 acm onlinejudge hustoj</a><a class="category-link" href="/categories/学习分享/">学习分享</a><a class="category-link" href="/categories/数据结构/">数据结构</a><a class="category-link" href="/categories/经验分享/">经验分享</a><a class="category-link" href="/categories/经验分享/学习分享/">学习分享</a><a class="category-link" href="/categories/默认分类/">默认分类</a><a class="category-link" href="/categories/默认分类/复习/">复习</a><a class="category-link" href="/categories/默认分类/复习/学习分享/">学习分享</a><a class="category-link" href="/categories/默认分类/学习分享/">学习分享</a><a class="category-link" href="/categories/默认分类/生活杂谈/">生活杂谈</a><a class="category-link" href="/categories/默认分类/经验分享/">经验分享</a><a class="category-link" href="/categories/默认分类/经验分享/学习分享/">学习分享</a>
        </div>
        <div id="sidebar-menu-box-tags">
            <a href="/tags/Java/" style="font-size: 10px;">Java</a> <a href="/tags/acm/" style="font-size: 12.86px;">acm</a> <a href="/tags/android/" style="font-size: 11.43px;">android</a> <a href="/tags/c/" style="font-size: 14.29px;">c++</a> <a href="/tags/fabric/" style="font-size: 11.43px;">fabric</a> <a href="/tags/kali/" style="font-size: 10px;">kali</a> <a href="/tags/linux/" style="font-size: 15.71px;">linux</a> <a href="/tags/linux学习/" style="font-size: 10px;">linux学习</a> <a href="/tags/mac/" style="font-size: 10px;">mac</a> <a href="/tags/mfc/" style="font-size: 10px;">mfc</a> <a href="/tags/onlinejudge/" style="font-size: 10px;">onlinejudge</a> <a href="/tags/sqlite/" style="font-size: 10px;">sqlite</a> <a href="/tags/sqlite3/" style="font-size: 11.43px;">sqlite3</a> <a href="/tags/ss/" style="font-size: 10px;">ss</a> <a href="/tags/vs/" style="font-size: 11.43px;">vs</a> <a href="/tags/xposed/" style="font-size: 10px;">xposed</a> <a href="/tags/xposed模块/" style="font-size: 10px;">xposed模块</a> <a href="/tags/专业知识/" style="font-size: 10px;">专业知识</a> <a href="/tags/侧链/" style="font-size: 10px;">侧链</a> <a href="/tags/内网穿透/" style="font-size: 10px;">内网穿透</a> <a href="/tags/区块链/" style="font-size: 11.43px;">区块链</a> <a href="/tags/复习/" style="font-size: 10px;">复习</a> <a href="/tags/学习/" style="font-size: 18.57px;">学习</a> <a href="/tags/安卓/" style="font-size: 12.86px;">安卓</a> <a href="/tags/小技巧/" style="font-size: 17.14px;">小技巧</a> <a href="/tags/数据库/" style="font-size: 10px;">数据库</a> <a href="/tags/数据结构/" style="font-size: 10px;">数据结构</a> <a href="/tags/日常使用问题/" style="font-size: 10px;">日常使用问题</a> <a href="/tags/最小生成树/" style="font-size: 11.43px;">最小生成树</a> <a href="/tags/最短路径/" style="font-size: 10px;">最短路径</a> <a href="/tags/比特币/" style="font-size: 11.43px;">比特币</a> <a href="/tags/算法/" style="font-size: 12.86px;">算法</a> <a href="/tags/算法笔记/" style="font-size: 11.43px;">算法笔记</a> <a href="/tags/经验/" style="font-size: 20px;">经验</a> <a href="/tags/编译原理/" style="font-size: 10px;">编译原理</a> <a href="/tags/翻译/" style="font-size: 10px;">翻译</a> <a href="/tags/自然计算/" style="font-size: 10px;">自然计算</a>
        </div>
    </div>
    <a href="javascript:;" class="sidebar-menu-box-close">&times;</a>
</div>
<div class="mobile-header-menu-nav" id="mobile-header-menu-nav">
    <div class="mobile-header-menu-container">
        <span class="title">Menus</span>
        <ul class="mobile-header-menu-navbar">
            
            <li>
                <a  href="/">
                    <i class="fa fa-home"></i><span>主页</span>
                </a>
            </li>
            
            <li>
                <a  href="/archives">
                    <i class="fa fa-archive"></i><span>归档</span>
                </a>
            </li>
            
            <li>
                <a  href="/friends">
                    <i class="fa fa-envira"></i><span>友链</span>
                </a>
            </li>
            
            <li>
                <a  href="/about">
                    <i class="fa fa-user"></i><span>关于我</span>
                </a>
            </li>
            
        </ul>
    </div>
    <div class="mobile-header-tag-container">
        <span class="title">Tags</span>
        <div id="mobile-header-container-tags">
            <a href="/tags/Java/" style="font-size: 10px;">Java</a> <a href="/tags/acm/" style="font-size: 12.86px;">acm</a> <a href="/tags/android/" style="font-size: 11.43px;">android</a> <a href="/tags/c/" style="font-size: 14.29px;">c++</a> <a href="/tags/fabric/" style="font-size: 11.43px;">fabric</a> <a href="/tags/kali/" style="font-size: 10px;">kali</a> <a href="/tags/linux/" style="font-size: 15.71px;">linux</a> <a href="/tags/linux学习/" style="font-size: 10px;">linux学习</a> <a href="/tags/mac/" style="font-size: 10px;">mac</a> <a href="/tags/mfc/" style="font-size: 10px;">mfc</a> <a href="/tags/onlinejudge/" style="font-size: 10px;">onlinejudge</a> <a href="/tags/sqlite/" style="font-size: 10px;">sqlite</a> <a href="/tags/sqlite3/" style="font-size: 11.43px;">sqlite3</a> <a href="/tags/ss/" style="font-size: 10px;">ss</a> <a href="/tags/vs/" style="font-size: 11.43px;">vs</a> <a href="/tags/xposed/" style="font-size: 10px;">xposed</a> <a href="/tags/xposed模块/" style="font-size: 10px;">xposed模块</a> <a href="/tags/专业知识/" style="font-size: 10px;">专业知识</a> <a href="/tags/侧链/" style="font-size: 10px;">侧链</a> <a href="/tags/内网穿透/" style="font-size: 10px;">内网穿透</a> <a href="/tags/区块链/" style="font-size: 11.43px;">区块链</a> <a href="/tags/复习/" style="font-size: 10px;">复习</a> <a href="/tags/学习/" style="font-size: 18.57px;">学习</a> <a href="/tags/安卓/" style="font-size: 12.86px;">安卓</a> <a href="/tags/小技巧/" style="font-size: 17.14px;">小技巧</a> <a href="/tags/数据库/" style="font-size: 10px;">数据库</a> <a href="/tags/数据结构/" style="font-size: 10px;">数据结构</a> <a href="/tags/日常使用问题/" style="font-size: 10px;">日常使用问题</a> <a href="/tags/最小生成树/" style="font-size: 11.43px;">最小生成树</a> <a href="/tags/最短路径/" style="font-size: 10px;">最短路径</a> <a href="/tags/比特币/" style="font-size: 11.43px;">比特币</a> <a href="/tags/算法/" style="font-size: 12.86px;">算法</a> <a href="/tags/算法笔记/" style="font-size: 11.43px;">算法笔记</a> <a href="/tags/经验/" style="font-size: 20px;">经验</a> <a href="/tags/编译原理/" style="font-size: 10px;">编译原理</a> <a href="/tags/翻译/" style="font-size: 10px;">翻译</a> <a href="/tags/自然计算/" style="font-size: 10px;">自然计算</a>
        </div>
    </div>
</div>
<div class="search-wrap">
    <span class="search-close">&times;</span>
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
            <i class="icon icon-lg icon-chevron-left"></i>
        </a>
        <input class="search-field" placeholder="Search..." id="keywords">
        <a id="search-submit" href="javascript:;">
            <i class="fa fa-search"></i>
        </a>
    <div class="search-container" id="search-container">
        <ul class="search-result" id="search-result">
        </ul>
    </div>
</div>

<div id="search-tpl">
    <li class="search-result-item">
        <a href="{url}" class="search-item-li">
            <span class="search-item-li-title" title="{title}">{title}</span>
        </a>
    </li>
</div>
<script src="/js/search.js"></script>
<script src="/js/main.js"></script>


  <script src="//cdn.bootcss.com/particles.js/2.0.0/particles.min.js"></script>
  <div id="particles"></div>
  <script src="/js/particles.js"></script>







  <link rel="stylesheet" href="//cdn.bootcss.com/animate.css/3.5.0/animate.min.css">
  <script src="//cdn.bootcss.com/scrollReveal.js/3.0.5/scrollreveal.js"></script>
  <script src="/js/animate.js"></script>


  <script src="/js/pop-img.js"></script>
  <script>
     $(".article-entry p img").popImg();
  </script>

  </div>
</body>
</html>